package com.example.JavaWebApi.controller.neo4j;

import com.example.JavaWebApi.model.neo4j.node.Person;
import com.example.JavaWebApi.service.neo4j.IPersonService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @program: java-web-api
 * @description:
 * @author: 杨泽
 * @create: 2023-09-13 13:54
 */
@RestController
@RequestMapping("/api/person")
@Api(tags = "人物")
public class PersonController {
    @Autowired
    private IPersonService personService;
    @PostMapping("Save")
    @ApiOperation("保存")
    public Boolean save(@RequestBody Person person){
        return personService.add(person);
    }
    @GetMapping("GetAll")
    @ApiOperation("获取全部")
    public List<Person> getAll(){
        return personService.getAll();
    }
}